/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: ${USER}
 * Date: ${YEAR}-${MONTH}-${DAY}
 * Time: ${TIME}
 */
class Student{
    public String name;
    public String gender;
    public int age;
    public double score;
    public static String classRoom = "Bit306";
    public Student(String a,String b,int c,double d){
        System.out.print(a+"  ");
        System.out.print(b+"  ");
        System.out.print(c+"  ");
        System.out.print(d+"  ");
        System.out.println(classRoom);
        System.out.println();
    }
    // ...
}
public class main2 {
    //    public int year=2020;
//    public int month=2021;
//    public int day=2022;
//    public  Main(int year, int month, int day) {
//// 成员变量在定义时，并没有给初始值, 为什么就可以使用呢？
//        System.out.println(this.year=year);
//        System.out.println(this.month=month);
//        System.out.println(this.day=day);
//    }
//    //局部变量
//    //成员变量
//    public static void main(String[] args) {
//// 此处a没有初始化，编译时报错：
//// Error:(24, 28) java: 可能尚未初始化变量a
//// int a;
//// System.out.println(a);
//        Main d = new Main(1111,6,9);
//    }
    public static void main(String[] args) {
// 静态成员变量可以直接通过类名访问
        System.out.println(Student.classRoom);
        Student s1 = new Student("Li leilei", "男", 18, 3.8);
        Student s2 = new Student("Han MeiMei", "女", 19, 4.0);
        Student s3 = new Student("Jim", "男", 18, 2.6);
// 也可以通过对象访问：但是classRoom是三个对象共享的
        System.out.println(s1.classRoom);
        System.out.println(s2.classRoom);
        System.out.println(s3.classRoom);
    }
}